<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .con {
            width: 180px;
            height: 30px;
            border: 1px solid black;
            font-size: larger;
            display: none;
        }
    </style>
</head>

<body>
    <a
        href="https://www.bilibili.com/video/BV1Sy4y1C7ha?p=265&spm_id_from=pageDriver&vd_source=480c28921b1b6c12cb33e4a6f0a94947">视频链接</a>
    <div class="search">
        <div class="con"></div>
        <input type="text" placeholder="请输入您的快递单号" class="jd">
    </div>
    <script>
        let con = document.querySelector('.con');
        let jd_input = document.querySelector('.jd');
        //input输入内容时，隐藏框出现起放大作用
        jd_input.addEventListener('keyup', function () {
            if (this.value == '') {
                con.style.display = 'none'
            } else {
                con.style.display = 'block';
                con.innerHTML = this.value;
            }
        })
        //失去焦点时，隐藏con盒子
        jd_input.addEventListener('blur', function () {
            con.style.display = 'none';
        })
        //获得焦点，显示con盒子
        jd_input.addEventListener('focus', function () {
            if (this.value !== '') {
                con.style.display = 'block';
            }
        })
    </script>

</body>

</html>